


ARM Macro Assembler    Page 1 


    1 00000000         ;/******************************************************
                       ***********************
    2 00000000         ;*   startup.s: startup file for NXP LPC230x Family Micr
                       oprocessors
    3 00000000         ;*
    4 00000000         ;*   Copyright(C) 2006, NXP Semiconductor
    5 00000000         ;*   All rights reserved.
    6 00000000         ;*
    7 00000000         ;*   History
    8 00000000         ;*   2006.09.01  ver 1.00    Prelimnary version, first R
                       elease
    9 00000000         ;*
   10 00000000         ;*******************************************************
                       **********************/
   11 00000000                 PRESERVE8
   12 00000000         
   13 00000000         ;/*
   14 00000000         ; *  The STARTUP.S code is executed after CPU Reset. Thi
                       s file may be 
   15 00000000         ; *  translated with the following SET symbols. In uVisi
                       on these SET 
   16 00000000         ; *  symbols are entered under Options - ASM - Define.
   17 00000000         ; *
   18 00000000         ; *  REMAP: when set the startup code initializes the re
                       gister MEMMAP 
   19 00000000         ; *  which overwrites the settings of the CPU configurat
                       ion pins. The 
   20 00000000         ; *  startup and interrupt vectors are remapped from:
   21 00000000         ; *     0x00000000  default setting (not remapped)
   22 00000000         ; *     0x40000000  when RAM_MODE is used
   23 00000000         ; *
   24 00000000         ; *  RAM_MODE: when set the device is configured for cod
                       e execution
   25 00000000         ; *  from on-chip RAM starting at address 0x40000000. 
   26 00000000         ; */
   27 00000000         
   28 00000000         ; Standard definitions of Mode bits and Interrupt (I & F
                       ) flags in PSRs
   29 00000000         
   30 00000000 00000010 
                       Mode_USR
                               EQU              0x10
   31 00000000 00000011 
                       Mode_FIQ
                               EQU              0x11
   32 00000000 00000012 
                       Mode_IRQ
                               EQU              0x12
   33 00000000 00000013 
                       Mode_SVC
                               EQU              0x13
   34 00000000 00000017 
                       Mode_ABT
                               EQU              0x17
   35 00000000 0000001B 
                       Mode_UND
                               EQU              0x1B
   36 00000000 0000001F 
                       Mode_SYS



ARM Macro Assembler    Page 2 


                               EQU              0x1F
   37 00000000         
   38 00000000 00000080 
                       I_Bit   EQU              0x80        ; when I bit is set
                                                            , IRQ is disabled
   39 00000000 00000040 
                       F_Bit   EQU              0x40        ; when F bit is set
                                                            , FIQ is disabled
   40 00000000         
   41 00000000         ;// <h> Stack Configuration (Stack Sizes in Bytes)
   42 00000000         ;//   <o0> Undefined Mode      <0x0-0xFFFFFFFF:8>
   43 00000000         ;//   <o1> Supervisor Mode     <0x0-0xFFFFFFFF:8>
   44 00000000         ;//   <o2> Abort Mode          <0x0-0xFFFFFFFF:8>
   45 00000000         ;//   <o3> Fast Interrupt Mode <0x0-0xFFFFFFFF:8>
   46 00000000         ;//   <o4> Interrupt Mode      <0x0-0xFFFFFFFF:8>
   47 00000000         ;//   <o5> User/System Mode    <0x0-0xFFFFFFFF:8>
   48 00000000         ;// </h>
   49 00000000         
   50 00000000 00000000 
                       UND_Stack_Size
                               EQU              0x00000000
   51 00000000 00000100 
                       SVC_Stack_Size
                               EQU              0x00000100
   52 00000000 00000000 
                       ABT_Stack_Size
                               EQU              0x00000000
   53 00000000 00000000 
                       FIQ_Stack_Size
                               EQU              0x00000000
   54 00000000 00000100 
                       IRQ_Stack_Size
                               EQU              0x00000100
   55 00000000 00000200 
                       USR_Stack_Size
                               EQU              0x00000200
   56 00000000         
   58 00000000 00000400 
                       Stack_Size
                               EQU              (UND_Stack_Size + SVC_Stack_Siz
e + ABT_Stack_Size +                           FIQ_Stack_Size + IRQ_Stack_Size
 + USR_Stack_Size)
   59 00000000         
   60 00000000                 AREA             STACK, NOINIT, READWRITE, ALIGN
=3
   61 00000000         Stack_Mem
                               SPACE            Stack_Size
   62 00000400         
   63 00000400 00000400 
                       Stack_Top
                               EQU              Stack_Mem + Stack_Size
   64 00000400         
   65 00000400         ;// <h> Heap Configuration
   66 00000400         ;//   <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF>
   67 00000400         ;// </h>
   68 00000400         
   69 00000400 00000000 
                       Heap_Size
                               EQU              0x00000000



ARM Macro Assembler    Page 3 


   70 00000400         
   71 00000400                 AREA             HEAP, NOINIT, READWRITE, ALIGN=
3
   72 00000000         Heap_Mem
                               SPACE            Heap_Size
   73 00000000         
   74 00000000         ; Area Definition and Entry Point
   75 00000000         ;  Startup Code must be linked first at Address at which
                        it expects to run.
   76 00000000         
   77 00000000                 AREA             RESET, CODE, READONLY
   78 00000000                 ARM
   79 00000000         
   80 00000000         ; Exception Vectors
   81 00000000         ;  Mapped to Address 0.
   82 00000000         ;  Absolute addressing mode must be used.
   83 00000000         ;  Dummy Handlers are implemented as infinite loops whic
                       h can be modified.
   84 00000000         
   85 00000000 E59FF018 
                       Vectors LDR              PC, Reset_Addr
   86 00000004 E59FF018        LDR              PC, Undef_Addr
   87 00000008 E59FF018        LDR              PC, SWI_Addr
   88 0000000C E59FF018        LDR              PC, PAbt_Addr
   89 00000010 E59FF018        LDR              PC, DAbt_Addr
   90 00000014 E1A00000        NOP                          ; Reserved Vector 
   91 00000018         ;               LDR     PC, IRQ_Addr
   92 00000018 E51FF120        LDR              PC, [PC, #-0x0120] ; Vector fro
                                                            m VicVectAddr
   93 0000001C E59FF018        LDR              PC, FIQ_Addr
   94 00000020         
   95 00000020 00000000 
                       Reset_Addr
                               DCD              Reset_Handler
   96 00000024 00000000 
                       Undef_Addr
                               DCD              Undef_Handler
   97 00000028 00000000 
                       SWI_Addr
                               DCD              SWI_Handler
   98 0000002C 00000000 
                       PAbt_Addr
                               DCD              PAbt_Handler
   99 00000030 00000000 
                       DAbt_Addr
                               DCD              DAbt_Handler
  100 00000034 B9206E28        DCD              0xB9206E28  ; Reserved Address 
                                                            
  101 00000038 00000000 
                       IRQ_Addr
                               DCD              IRQ_Handler
  102 0000003C 00000000 
                       FIQ_Addr
                               DCD              FIQ_Handler
  103 00000040         
  104 00000040 EAFFFFFE 
                       Undef_Handler
                               B                Undef_Handler
  105 00000044 EAFFFFFE 



ARM Macro Assembler    Page 4 


                       SWI_Handler
                               B                SWI_Handler
  106 00000048 EAFFFFFE 
                       PAbt_Handler
                               B                PAbt_Handler
  107 0000004C EAFFFFFE 
                       DAbt_Handler
                               B                DAbt_Handler
  108 00000050 EAFFFFFE 
                       IRQ_Handler
                               B                IRQ_Handler
  109 00000054 EAFFFFFE 
                       FIQ_Handler
                               B                FIQ_Handler
  110 00000058         
  111 00000058         ; Reset Handler
  112 00000058         
  113 00000058                 EXPORT           Reset_Handler
  114 00000058         Reset_Handler
  115 00000058         
  116 00000058         ; Setup Stack for each mode
  117 00000058 E59F0050        LDR              R0, =Stack_Top
  118 0000005C         
  119 0000005C         ;  Enter Undefined Instruction Mode and set its Stack Po
                       inter
  120 0000005C E321F0DB        MSR              CPSR_c, #Mode_UND:OR:I_Bit:OR:F
_Bit
  121 00000060 E1A0D000        MOV              SP, R0
  122 00000064 E2400000        SUB              R0, R0, #UND_Stack_Size
  123 00000068         
  124 00000068         ;  Enter Abort Mode and set its Stack Pointer
  125 00000068 E321F0D7        MSR              CPSR_c, #Mode_ABT:OR:I_Bit:OR:F
_Bit
  126 0000006C E1A0D000        MOV              SP, R0
  127 00000070 E2400000        SUB              R0, R0, #ABT_Stack_Size
  128 00000074         
  129 00000074         ;  Enter FIQ Mode and set its Stack Pointer
  130 00000074 E321F0D1        MSR              CPSR_c, #Mode_FIQ:OR:I_Bit:OR:F
_Bit
  131 00000078 E1A0D000        MOV              SP, R0
  132 0000007C E2400000        SUB              R0, R0, #FIQ_Stack_Size
  133 00000080         
  134 00000080         ;  Enter IRQ Mode and set its Stack Pointer
  135 00000080 E321F0D2        MSR              CPSR_c, #Mode_IRQ:OR:I_Bit:OR:F
_Bit
  136 00000084 E1A0D000        MOV              SP, R0
  137 00000088 E2400C01        SUB              R0, R0, #IRQ_Stack_Size
  138 0000008C         
  139 0000008C         ;  Enter Supervisor Mode and set its Stack Pointer
  140 0000008C E321F0D3        MSR              CPSR_c, #Mode_SVC:OR:I_Bit:OR:F
_Bit
  141 00000090 E1A0D000        MOV              SP, R0
  142 00000094 E2400C01        SUB              R0, R0, #SVC_Stack_Size
  143 00000098         
  144 00000098         ;  Enter User Mode and set its Stack Pointer
  145 00000098 E321F010        MSR              CPSR_c, #Mode_USR
  146 0000009C E1A0D000        MOV              SP, R0
  147 000000A0 E24DAC02        SUB              SL, SP, #USR_Stack_Size
  148 000000A4         



ARM Macro Assembler    Page 5 


  149 000000A4                 IMPORT           TargetResetInit
  150 000000A4 EBFFFFFE        BL               TargetResetInit
  151 000000A8         
  152 000000A8         ; Enter the C code
  153 000000A8         
  154 000000A8                 IMPORT           __main
  155 000000A8 E59F0004        LDR              R0, =__main
  156 000000AC E12FFF10        BX               R0
  157 000000B0         
  158 000000B0         
  159 000000B0         ; User Initial Stack & Heap
  160 000000B0 00000000 
              00000000         AREA             |.text|, CODE, READONLY
  161 00000000         
  162 00000000         ;IMPORT  __use_two_region_memory
  163 00000000                 EXPORT           __user_initial_stackheap
  164 00000000         __user_initial_stackheap
  165 00000000         
  166 00000000 E59F000C        LDR              R0, =  Heap_Mem
  167 00000004 E59F100C        LDR              R1, =(Stack_Mem + USR_Stack_Siz
e)
  168 00000008 E59F2004        LDR              R2, = (Heap_Mem +      Heap_Siz
e)
  169 0000000C E59F3008        LDR              R3, = Stack_Mem
  170 00000010 E12FFF1E        BX               LR
  171 00000014         
  172 00000014                 END
              00000000 
              00000200 
              00000000 
Command Line: --debug --xref --device=DARMP --apcs=interwork -o.\Startup.o -IC:
\Keil\ARM\INC\Philips --list=.\Startup.lst "C:\Documents and Settings\dissonanc
e\Рабочий стол\code[1].bundle.lpc23xx.lpc24xx.uvision\LPC23xx_24xxSampleSoftwar
e.r5\Keil\Common\src\Startup.s"



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Relocatable symbols

STACK 00000000

Symbol: STACK
   Definitions
      At line 60 in file C:\Documents
   Uses
      None
Comment: STACK unused
Stack_Mem 00000000

Symbol: Stack_Mem
   Definitions
      At line 61 in file C:\Documents
   Uses
      At line 63 in file C:\Documents
      At line 167 in file C:\Documents
      At line 169 in file C:\Documents

Stack_Top 00000400

Symbol: Stack_Top
   Definitions
      At line 63 in file C:\Documents
   Uses
      At line 117 in file C:\Documents
Comment: Stack_Top used once
3 symbols



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Relocatable symbols

HEAP 00000000

Symbol: HEAP
   Definitions
      At line 71 in file C:\Documents
   Uses
      None
Comment: HEAP unused
Heap_Mem 00000000

Symbol: Heap_Mem
   Definitions
      At line 72 in file C:\Documents
   Uses
      At line 166 in file C:\Documents
      At line 168 in file C:\Documents

2 symbols



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Relocatable symbols

DAbt_Addr 00000030

Symbol: DAbt_Addr
   Definitions
      At line 99 in file C:\Documents
   Uses
      At line 89 in file C:\Documents
Comment: DAbt_Addr used once
DAbt_Handler 0000004C

Symbol: DAbt_Handler
   Definitions
      At line 107 in file C:\Documents
   Uses
      At line 99 in file C:\Documents
      At line 107 in file C:\Documents

FIQ_Addr 0000003C

Symbol: FIQ_Addr
   Definitions
      At line 102 in file C:\Documents
   Uses
      At line 93 in file C:\Documents
Comment: FIQ_Addr used once
FIQ_Handler 00000054

Symbol: FIQ_Handler
   Definitions
      At line 109 in file C:\Documents
   Uses
      At line 102 in file C:\Documents
      At line 109 in file C:\Documents

IRQ_Addr 00000038

Symbol: IRQ_Addr
   Definitions
      At line 101 in file C:\Documents
   Uses
      None
Comment: IRQ_Addr unused
IRQ_Handler 00000050

Symbol: IRQ_Handler
   Definitions
      At line 108 in file C:\Documents
   Uses
      At line 101 in file C:\Documents
      At line 108 in file C:\Documents

PAbt_Addr 0000002C

Symbol: PAbt_Addr
   Definitions
      At line 98 in file C:\Documents
   Uses
      At line 88 in file C:\Documents
Comment: PAbt_Addr used once



ARM Macro Assembler    Page 2 Alphabetic symbol ordering
Relocatable symbols

PAbt_Handler 00000048

Symbol: PAbt_Handler
   Definitions
      At line 106 in file C:\Documents
   Uses
      At line 98 in file C:\Documents
      At line 106 in file C:\Documents

RESET 00000000

Symbol: RESET
   Definitions
      At line 77 in file C:\Documents
   Uses
      None
Comment: RESET unused
Reset_Addr 00000020

Symbol: Reset_Addr
   Definitions
      At line 95 in file C:\Documents
   Uses
      At line 85 in file C:\Documents
Comment: Reset_Addr used once
Reset_Handler 00000058

Symbol: Reset_Handler
   Definitions
      At line 114 in file C:\Documents
   Uses
      At line 95 in file C:\Documents
      At line 113 in file C:\Documents

SWI_Addr 00000028

Symbol: SWI_Addr
   Definitions
      At line 97 in file C:\Documents
   Uses
      At line 87 in file C:\Documents
Comment: SWI_Addr used once
SWI_Handler 00000044

Symbol: SWI_Handler
   Definitions
      At line 105 in file C:\Documents
   Uses
      At line 97 in file C:\Documents
      At line 105 in file C:\Documents

Undef_Addr 00000024

Symbol: Undef_Addr
   Definitions
      At line 96 in file C:\Documents
   Uses
      At line 86 in file C:\Documents
Comment: Undef_Addr used once



ARM Macro Assembler    Page 3 Alphabetic symbol ordering
Relocatable symbols

Undef_Handler 00000040

Symbol: Undef_Handler
   Definitions
      At line 104 in file C:\Documents
   Uses
      At line 96 in file C:\Documents
      At line 104 in file C:\Documents

Vectors 00000000

Symbol: Vectors
   Definitions
      At line 85 in file C:\Documents
   Uses
      None
Comment: Vectors unused
16 symbols



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Relocatable symbols

.text 00000000

Symbol: .text
   Definitions
      At line 160 in file C:\Documents
   Uses
      None
Comment: .text unused
__user_initial_stackheap 00000000

Symbol: __user_initial_stackheap
   Definitions
      At line 164 in file C:\Documents
   Uses
      At line 163 in file C:\Documents
Comment: __user_initial_stackheap used once
2 symbols



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Relocatable symbols

.debug_info$$$RESET 00000000

Symbol: .debug_info$$$RESET
   Definitions
      None
   Uses
      None
Warning: .debug_info$$$RESET undefinedComment: .debug_info$$$RESET unused
1 symbol



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Relocatable symbols

.debug_line$$$RESET 00000000

Symbol: .debug_line$$$RESET
   Definitions
      None
   Uses
      None
Warning: .debug_line$$$RESET undefinedComment: .debug_line$$$RESET unused
1 symbol



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Relocatable symbols

.debug_info$$$.text 00000000

Symbol: .debug_info$$$.text
   Definitions
      None
   Uses
      None
Warning: .debug_info$$$.text undefinedComment: .debug_info$$$.text unused
1 symbol



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Relocatable symbols

.debug_line$$$.text 00000000

Symbol: .debug_line$$$.text
   Definitions
      None
   Uses
      None
Warning: .debug_line$$$.text undefinedComment: .debug_line$$$.text unused
1 symbol



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Relocatable symbols

.debug_abbrev 00000000

Symbol: .debug_abbrev
   Definitions
      None
   Uses
      None
Warning: .debug_abbrev undefinedComment: .debug_abbrev unused
__ARM_asm.debug_abbrev 00000000

Symbol: __ARM_asm.debug_abbrev
   Definitions
      None
   Uses
      None
Warning: __ARM_asm.debug_abbrev undefinedComment: __ARM_asm.debug_abbrev unused
2 symbols



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Absolute symbols

ABT_Stack_Size 00000000

Symbol: ABT_Stack_Size
   Definitions
      At line 52 in file C:\Documents
   Uses
      At line 58 in file C:\Documents
      At line 127 in file C:\Documents

FIQ_Stack_Size 00000000

Symbol: FIQ_Stack_Size
   Definitions
      At line 53 in file C:\Documents
   Uses
      At line 58 in file C:\Documents
      At line 132 in file C:\Documents

F_Bit 00000040

Symbol: F_Bit
   Definitions
      At line 39 in file C:\Documents
   Uses
      At line 120 in file C:\Documents
      At line 125 in file C:\Documents
      At line 130 in file C:\Documents
      At line 135 in file C:\Documents
      At line 140 in file C:\Documents

Heap_Size 00000000

Symbol: Heap_Size
   Definitions
      At line 69 in file C:\Documents
   Uses
      At line 72 in file C:\Documents
      At line 168 in file C:\Documents

IRQ_Stack_Size 00000100

Symbol: IRQ_Stack_Size
   Definitions
      At line 54 in file C:\Documents
   Uses
      At line 58 in file C:\Documents
      At line 137 in file C:\Documents

I_Bit 00000080

Symbol: I_Bit
   Definitions
      At line 38 in file C:\Documents
   Uses
      At line 120 in file C:\Documents
      At line 125 in file C:\Documents
      At line 130 in file C:\Documents
      At line 135 in file C:\Documents
      At line 140 in file C:\Documents



ARM Macro Assembler    Page 2 Alphabetic symbol ordering
Absolute symbols


Mode_ABT 00000017

Symbol: Mode_ABT
   Definitions
      At line 34 in file C:\Documents
   Uses
      At line 125 in file C:\Documents
Comment: Mode_ABT used once
Mode_FIQ 00000011

Symbol: Mode_FIQ
   Definitions
      At line 31 in file C:\Documents
   Uses
      At line 130 in file C:\Documents
Comment: Mode_FIQ used once
Mode_IRQ 00000012

Symbol: Mode_IRQ
   Definitions
      At line 32 in file C:\Documents
   Uses
      At line 135 in file C:\Documents
Comment: Mode_IRQ used once
Mode_SVC 00000013

Symbol: Mode_SVC
   Definitions
      At line 33 in file C:\Documents
   Uses
      At line 140 in file C:\Documents
Comment: Mode_SVC used once
Mode_SYS 0000001F

Symbol: Mode_SYS
   Definitions
      At line 36 in file C:\Documents
   Uses
      None
Comment: Mode_SYS unused
Mode_UND 0000001B

Symbol: Mode_UND
   Definitions
      At line 35 in file C:\Documents
   Uses
      At line 120 in file C:\Documents
Comment: Mode_UND used once
Mode_USR 00000010

Symbol: Mode_USR
   Definitions
      At line 30 in file C:\Documents
   Uses
      At line 145 in file C:\Documents
Comment: Mode_USR used once
SVC_Stack_Size 00000100




ARM Macro Assembler    Page 3 Alphabetic symbol ordering
Absolute symbols

Symbol: SVC_Stack_Size
   Definitions
      At line 51 in file C:\Documents
   Uses
      At line 58 in file C:\Documents
      At line 142 in file C:\Documents

Stack_Size 00000400

Symbol: Stack_Size
   Definitions
      At line 58 in file C:\Documents
   Uses
      At line 61 in file C:\Documents
      At line 63 in file C:\Documents

UND_Stack_Size 00000000

Symbol: UND_Stack_Size
   Definitions
      At line 50 in file C:\Documents
   Uses
      At line 58 in file C:\Documents
      At line 122 in file C:\Documents

USR_Stack_Size 00000200

Symbol: USR_Stack_Size
   Definitions
      At line 55 in file C:\Documents
   Uses
      At line 58 in file C:\Documents
      At line 147 in file C:\Documents
      At line 167 in file C:\Documents

17 symbols



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
External symbols

TargetResetInit 00000000

Symbol: TargetResetInit
   Definitions
      At line 149 in file C:\Documents
   Uses
      At line 150 in file C:\Documents
Comment: TargetResetInit used once
__main 00000000

Symbol: __main
   Definitions
      At line 154 in file C:\Documents
   Uses
      At line 155 in file C:\Documents
Comment: __main used once
2 symbols
371 symbols in table
